package io.github.yidasanqian.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;

/**
 * @author Linyu Chen
 */
@Data
public class ContentCategoryVO implements Serializable {
    private static final long serialVersionUID = 3656420979179525631L;
    /**
     * 类目ID
     */
    private Long id;

    /**
     * 类目名称
     */
    private String text;

    private String state;

    /**
     * true:父类目树状态"closed", false:子类目树状态"open"
     */
    @JsonIgnore
    private Boolean isParent;

    public String getState() {
        return isParent ? "closed" : "open";
    }
}
